<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page import="net.tribal.comic.entities.Comic" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="title.comic.create"/></title>
    </head>
    
    <body>
        <div class="navButtonsTop rounded-corners">
			<h1 class="title"><g:message code="title.comic.create"/></h1>
	    </div>
		    
		<g:uploadForm action="save">
			<div class="element">
				<g:hasErrors bean="${comicInstance}">
		            <div class="errors rounded-corners"><g:renderErrors bean="${comicInstance}" as="list" /></div>
	            </g:hasErrors>
	            
	            <div class="tableCreate">
	                <table>
	                    <tbody>
	                        <tr>
	                            <td class="name">
	                                <label for="title"><g:message code="default.label.title"/>:</label>
	                            </td>
	                            <td colspan="5" class="value requiredField ${hasErrors(bean: comicInstance, field: 'title', 'errors')}">
	                                <g:textField class="focus" name="title" size="50" maxlength="50" value="${fieldValue(bean: comicInstance, field: 'title')}" />
	                            </td>
	                        </tr>
	                        
	                        <tr>
	                        	<td class="name">
	                      			<label for="file"><g:message code="default.label.path"/>:</label></td>
	                      		<td colspan="5" class="value ${hasErrors(bean: comicInstance, field: 'path', 'errors')}">
	                      			<input type="file" name="file"/>
	                      		</td>
	                        </tr>
	                    
	                        <tr>
	                            <td colspan="6" class="value ${hasErrors(bean: comicInstance, field: 'description', 'errors')}">
									<richui:richTextEditor name="description" value="${comicInstance?.description}" width="600"/>
	                            </td>
	                        </tr>
	                    
	                        <tr>
	                            <td class="name">
	                                <label for="rateable"><g:message code="default.label.rateable"/>:</label>
	                            </td>
	                            <td class="value ${hasErrors(bean: comicInstance, field: 'rateable', 'errors')}">
	                                <g:checkBox name="rateable" value="${comicInstance?.rateable}" />
	                            </td>
	                            <td class="name">
	                                <label for="commentable"><g:message code="default.label.commentable"/>:</label>
	                            </td>
	                            <td class="value ${hasErrors(bean: comicInstance, field: 'commentable', 'errors')}">
	                                <g:checkBox name="commentable" value="${comicInstance?.commentable}" />
	                            </td>
	                            <td class="name">
	                            	<usr:isAdmin>
	                                	<label for="disabled"><g:message code="default.label.disabled"/>:</label>
	                               	</usr:isAdmin>
	                            </td>
	                            <td class="value ${hasErrors(bean: comicInstance, field: 'disabled', 'errors')}">
	                            	<usr:isAdmin>
	                                	<g:checkBox name="disabled" value="${comicInstance?.disabled}" />
	                                </usr:isAdmin>
	                            </td>
	                        </tr>
	                    </tbody>
	                </table>
                </div>
        	</div>
        		                
           	<div class="navButtons rounded-corners">
           		<div class="left">
               		<g:submitButton name="create" class="save" value="${message(code:'default.button.create')}"/>
               	</div>
            </div>
		</g:uploadForm>
    </body>
</html>
